﻿
@{
    ViewBag.Title = "麻醉方式详细信息";
    Layout = "~/Views/Shared/_Form.cshtml";
}


<form id="form1">
    <div style="padding-top: 20px; margin-right: 30px;">
        <table class="form">
            <tr>
                <th class="formTitle">麻醉代码：</th>
                <td class="formValue">
                    <input id="AnesCode" name="AnesCode" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">麻醉名称：</th>
                <td class="formValue">
                    <input id="AnesName" name="AnesName" type="text" onchange="getZjm()" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">助记码：</th>
                <td class="formValue">
                    <input id="Aneszjm" name="Aneszjm" type="text" readonly="true" class="form-control" />
                </td>
            </tr>
        </table>
    </div>
</form>


<script>
    var keyValue = $.request("keyValue");
    $(function () {
        if (!!keyValue) {
            $.ajax({
                url: "/Operation/OpAnesthesia/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                success: function (data) {
                    $("#form1").formSerialize(data);
                    getZjm();
                }
            });
        }
    });

    function AcceptClick(callBack) {
        if (!$('#form1').formValid()) {
            return false;
        }
        var postData = $("#form1").formSerialize();

        $.submitForm({
            url: "/Operation/OpAnesthesia/SubmitForm?keyValue=" + keyValue,
            param: postData,
            success: function () {
                callBack();
                $.modalClose();
            }
        });
    }

    //获取手术名称首拼音
    function getZjm() {
        var AnesName = $("#AnesName").val();
        if (AnesName) {
            var Aneszjm = $("#AnesName").toShouPin();
            $("#Aneszjm").val(Aneszjm);
        }
    }
</script>
